********************************************************************************
** TITLE:      poll_regulation_ijpor                                          **  
** AUTHOR:     Review version                                                 **
** DATA:       Review version                                                 **
** DATE:       February 2023                                                  ** 
** VERSION:	   Stata 16					                                      **	
********************************************************************************

set more off

* Version control

version 16.0

* Open log file

capture log close       			  			              
log using "poll_regulation", replace

* Open the dataset

use "CES2019 Campaign Period Survey reviewversion module data 2019-12-03.dta", clear 

* Add value labels

numlabel _all, add force

* Add political efficacy variable from full dataset 

merge 1:1 cps19_ResponseId using "2019 Canadian Election Study - Online Survey v1.0 (With Political knowledge coded).dta", keepusing(cps19_govt_confusing)


*****************************
** DISTRICT-LEVEL OUTCOMES **
*****************************

* Note: 1 = Liberal, 2 = Conservative, 3 = NDP, 4 = BQ, 5 = Greens, 6 = People's Party, 7 = other

gen district_outcome = .

replace district_outcome = 1 if constituencynumber == 10001
replace district_outcome = 1 if constituencynumber == 10002
replace district_outcome = 1 if constituencynumber == 10003
replace district_outcome = 1 if constituencynumber == 10004
replace district_outcome = 1 if constituencynumber == 10005
replace district_outcome = 3 if constituencynumber == 10006
replace district_outcome = 1 if constituencynumber == 10007
replace district_outcome = 1 if constituencynumber == 11001
replace district_outcome = 1 if constituencynumber == 11002
replace district_outcome = 1 if constituencynumber == 11003
replace district_outcome = 1 if constituencynumber == 11004
replace district_outcome = 1 if constituencynumber == 12001
replace district_outcome = 1 if constituencynumber == 12002
replace district_outcome = 1 if constituencynumber == 12003
replace district_outcome = 1 if constituencynumber == 12004
replace district_outcome = 1 if constituencynumber == 12005
replace district_outcome = 1 if constituencynumber == 12006
replace district_outcome = 1 if constituencynumber == 12007
replace district_outcome = 1 if constituencynumber == 12008
replace district_outcome = 1 if constituencynumber == 12009
replace district_outcome = 1 if constituencynumber == 12010
replace district_outcome = 2 if constituencynumber == 12011
replace district_outcome = 1 if constituencynumber == 13001
replace district_outcome = 1 if constituencynumber == 13002
replace district_outcome = 5 if constituencynumber == 13003
replace district_outcome = 2 if constituencynumber == 13004
replace district_outcome = 1 if constituencynumber == 13005
replace district_outcome = 1 if constituencynumber == 13006
replace district_outcome = 1 if constituencynumber == 13007
replace district_outcome = 2 if constituencynumber == 13008
replace district_outcome = 1 if constituencynumber == 13009
replace district_outcome = 2 if constituencynumber == 13010
replace district_outcome = 4 if constituencynumber == 24001
replace district_outcome = 4 if constituencynumber == 24002
replace district_outcome = 1 if constituencynumber == 24003
replace district_outcome = 1 if constituencynumber == 24004
replace district_outcome = 1 if constituencynumber == 24005
replace district_outcome = 4 if constituencynumber == 24006
replace district_outcome = 2 if constituencynumber == 24007
replace district_outcome = 4 if constituencynumber == 24008
replace district_outcome = 4 if constituencynumber == 24009
replace district_outcome = 2 if constituencynumber == 24010
replace district_outcome = 4 if constituencynumber == 24011
replace district_outcome = 4 if constituencynumber == 24012
replace district_outcome = 4 if constituencynumber == 24013
replace district_outcome = 4 if constituencynumber == 24014
replace district_outcome = 1 if constituencynumber == 24015
replace district_outcome = 1 if constituencynumber == 24016
replace district_outcome = 1 if constituencynumber == 24017
replace district_outcome = 4 if constituencynumber == 24018
replace district_outcome = 2 if constituencynumber == 24019
replace district_outcome = 4 if constituencynumber == 24020
replace district_outcome = 1 if constituencynumber == 24021
replace district_outcome = 2 if constituencynumber == 24022
replace district_outcome = 1 if constituencynumber == 24023
replace district_outcome = 1 if constituencynumber == 24024
replace district_outcome = 4 if constituencynumber == 24025
replace district_outcome = 1 if constituencynumber == 24026
replace district_outcome = 1 if constituencynumber == 24027
replace district_outcome = 1 if constituencynumber == 24028
replace district_outcome = 1 if constituencynumber == 24029
replace district_outcome = 1 if constituencynumber == 24030
replace district_outcome = 4 if constituencynumber == 24031
replace district_outcome = 4 if constituencynumber == 24032
replace district_outcome = 4 if constituencynumber == 24033
replace district_outcome = 4 if constituencynumber == 24034
replace district_outcome = 4 if constituencynumber == 24035
replace district_outcome = 1 if constituencynumber == 24036
replace district_outcome = 1 if constituencynumber == 24037
replace district_outcome = 4 if constituencynumber == 24038
replace district_outcome = 1 if constituencynumber == 24039
replace district_outcome = 1 if constituencynumber == 24040
replace district_outcome = 1 if constituencynumber == 24041
replace district_outcome = 2 if constituencynumber == 24042
replace district_outcome = 4 if constituencynumber == 24043
replace district_outcome = 1 if constituencynumber == 24044
replace district_outcome = 2 if constituencynumber == 24045
replace district_outcome = 4 if constituencynumber == 24046
replace district_outcome = 2 if constituencynumber == 24047
replace district_outcome = 4 if constituencynumber == 24048
replace district_outcome = 4 if constituencynumber == 24049
replace district_outcome = 4 if constituencynumber == 24050
replace district_outcome = 2 if constituencynumber == 24051
replace district_outcome = 1 if constituencynumber == 24052
replace district_outcome = 1 if constituencynumber == 24053
replace district_outcome = 1 if constituencynumber == 24054
replace district_outcome = 1 if constituencynumber == 24055
replace district_outcome = 1 if constituencynumber == 24056
replace district_outcome = 1 if constituencynumber == 24057
replace district_outcome = 2 if constituencynumber == 24058
replace district_outcome = 1 if constituencynumber == 24059
replace district_outcome = 4 if constituencynumber == 24060
replace district_outcome = 2 if constituencynumber == 24061
replace district_outcome = 4 if constituencynumber == 24062
replace district_outcome = 4 if constituencynumber == 24063
replace district_outcome = 3 if constituencynumber == 24064
replace district_outcome = 1 if constituencynumber == 24065
replace district_outcome = 4 if constituencynumber == 24066
replace district_outcome = 4 if constituencynumber == 24067
replace district_outcome = 1 if constituencynumber == 24068
replace district_outcome = 1 if constituencynumber == 24069
replace district_outcome = 1 if constituencynumber == 24070
replace district_outcome = 4 if constituencynumber == 24071
replace district_outcome = 4 if constituencynumber == 24072
replace district_outcome = 1 if constituencynumber == 24073
replace district_outcome = 1 if constituencynumber == 24074
replace district_outcome = 4 if constituencynumber == 24075
replace district_outcome = 4 if constituencynumber == 24076
replace district_outcome = 1 if constituencynumber == 24077
replace district_outcome = 1 if constituencynumber == 24078
replace district_outcome = 1 if constituencynumber == 35001
replace district_outcome = 3 if constituencynumber == 35002
replace district_outcome = 2 if constituencynumber == 35003
replace district_outcome = 2 if constituencynumber == 35004
replace district_outcome = 2 if constituencynumber == 35005
replace district_outcome = 1 if constituencynumber == 35006
replace district_outcome = 1 if constituencynumber == 35007
replace district_outcome = 1 if constituencynumber == 35008
replace district_outcome = 1 if constituencynumber == 35009
replace district_outcome = 1 if constituencynumber == 35010
replace district_outcome = 1 if constituencynumber == 35011
replace district_outcome = 1 if constituencynumber == 35012
replace district_outcome = 2 if constituencynumber == 35013
replace district_outcome = 2 if constituencynumber == 35014
replace district_outcome = 1 if constituencynumber == 35015
replace district_outcome = 1 if constituencynumber == 35016
replace district_outcome = 2 if constituencynumber == 35017
replace district_outcome = 1 if constituencynumber == 35018
replace district_outcome = 1 if constituencynumber == 35019
replace district_outcome = 1 if constituencynumber == 35020
replace district_outcome = 1 if constituencynumber == 35021
replace district_outcome = 2 if constituencynumber == 35022
replace district_outcome = 2 if constituencynumber == 35023
replace district_outcome = 1 if constituencynumber == 35024
replace district_outcome = 2 if constituencynumber == 35025
replace district_outcome = 2 if constituencynumber == 35026
replace district_outcome = 1 if constituencynumber == 35027
replace district_outcome = 1 if constituencynumber == 35028
replace district_outcome = 1 if constituencynumber == 35029
replace district_outcome = 2 if constituencynumber == 35030
replace district_outcome = 1 if constituencynumber == 35031
replace district_outcome = 1 if constituencynumber == 35032
replace district_outcome = 2 if constituencynumber == 35033
replace district_outcome = 2 if constituencynumber == 35034
replace district_outcome = 3 if constituencynumber == 35035
replace district_outcome = 1 if constituencynumber == 35036
replace district_outcome = 3 if constituencynumber == 35037
replace district_outcome = 1 if constituencynumber == 35038
replace district_outcome = 2 if constituencynumber == 35039
replace district_outcome = 2 if constituencynumber == 35040
replace district_outcome = 1 if constituencynumber == 35041
replace district_outcome = 2 if constituencynumber == 35042
replace district_outcome = 1 if constituencynumber == 35043
replace district_outcome = 1 if constituencynumber == 35044
replace district_outcome = 1 if constituencynumber == 35045
replace district_outcome = 1 if constituencynumber == 35046
replace district_outcome = 1 if constituencynumber == 35047
replace district_outcome = 2 if constituencynumber == 35048
replace district_outcome = 2 if constituencynumber == 35049
replace district_outcome = 2 if constituencynumber == 35050
replace district_outcome = 3 if constituencynumber == 35051
replace district_outcome = 1 if constituencynumber == 35052
replace district_outcome = 1 if constituencynumber == 35053
replace district_outcome = 1 if constituencynumber == 35054
replace district_outcome = 1 if constituencynumber == 35055
replace district_outcome = 2 if constituencynumber == 35056
replace district_outcome = 1 if constituencynumber == 35057
replace district_outcome = 1 if constituencynumber == 35058
replace district_outcome = 1 if constituencynumber == 35059
replace district_outcome = 1 if constituencynumber == 35060
replace district_outcome = 1 if constituencynumber == 35061
replace district_outcome = 1 if constituencynumber == 35062
replace district_outcome = 1 if constituencynumber == 35063
replace district_outcome = 1 if constituencynumber == 35064
replace district_outcome = 1 if constituencynumber == 35065
replace district_outcome = 1 if constituencynumber == 35066
replace district_outcome = 2 if constituencynumber == 35067
replace district_outcome = 2 if constituencynumber == 35068
replace district_outcome = 1 if constituencynumber == 35069
replace district_outcome = 1 if constituencynumber == 35070
replace district_outcome = 2 if constituencynumber == 35071
replace district_outcome = 1 if constituencynumber == 35072
replace district_outcome = 1 if constituencynumber == 35073
replace district_outcome = 2 if constituencynumber == 35074
replace district_outcome = 1 if constituencynumber == 35075
replace district_outcome = 1 if constituencynumber == 35076
replace district_outcome = 1 if constituencynumber == 35077
replace district_outcome = 1 if constituencynumber == 35078
replace district_outcome = 1 if constituencynumber == 35079
replace district_outcome = 2 if constituencynumber == 35080
replace district_outcome = 1 if constituencynumber == 35081
replace district_outcome = 2 if constituencynumber == 35082
replace district_outcome = 2 if constituencynumber == 35083
replace district_outcome = 1 if constituencynumber == 35084
replace district_outcome = 1 if constituencynumber == 35085
replace district_outcome = 2 if constituencynumber == 35086
replace district_outcome = 1 if constituencynumber == 35087
replace district_outcome = 2 if constituencynumber == 35088
replace district_outcome = 1 if constituencynumber == 35089
replace district_outcome = 1 if constituencynumber == 35090
replace district_outcome = 2 if constituencynumber == 35091
replace district_outcome = 1 if constituencynumber == 35092
replace district_outcome = 1 if constituencynumber == 35093
replace district_outcome = 1 if constituencynumber == 35094
replace district_outcome = 1 if constituencynumber == 35095
replace district_outcome = 1 if constituencynumber == 35096
replace district_outcome = 1 if constituencynumber == 35097
replace district_outcome = 1 if constituencynumber == 35098
replace district_outcome = 2 if constituencynumber == 35099
replace district_outcome = 2 if constituencynumber == 35100
replace district_outcome = 1 if constituencynumber == 35101
replace district_outcome = 2 if constituencynumber == 35102
replace district_outcome = 1 if constituencynumber == 35103
replace district_outcome = 2 if constituencynumber == 35104
replace district_outcome = 1 if constituencynumber == 35105
replace district_outcome = 1 if constituencynumber == 35106
replace district_outcome = 3 if constituencynumber == 35107
replace district_outcome = 1 if constituencynumber == 35108
replace district_outcome = 1 if constituencynumber == 35109
replace district_outcome = 1 if constituencynumber == 35110
replace district_outcome = 1 if constituencynumber == 35111
replace district_outcome = 1 if constituencynumber == 35112
replace district_outcome = 2 if constituencynumber == 35113
replace district_outcome = 1 if constituencynumber == 35114
replace district_outcome = 1 if constituencynumber == 35115
replace district_outcome = 1 if constituencynumber == 35116
replace district_outcome = 3 if constituencynumber == 35117
replace district_outcome = 1 if constituencynumber == 35118
replace district_outcome = 2 if constituencynumber == 35119
replace district_outcome = 1 if constituencynumber == 35120
replace district_outcome = 1 if constituencynumber == 35121
replace district_outcome = 2 if constituencynumber == 46001
replace district_outcome = 2 if constituencynumber == 46002
replace district_outcome = 3 if constituencynumber == 46003
replace district_outcome = 2 if constituencynumber == 46004
replace district_outcome = 3 if constituencynumber == 46005
replace district_outcome = 2 if constituencynumber == 46006
replace district_outcome = 2 if constituencynumber == 46007
replace district_outcome = 2 if constituencynumber == 46008
replace district_outcome = 1 if constituencynumber == 46009
replace district_outcome = 2 if constituencynumber == 46010
replace district_outcome = 3 if constituencynumber == 46011
replace district_outcome = 1 if constituencynumber == 46012
replace district_outcome = 1 if constituencynumber == 46013
replace district_outcome = 1 if constituencynumber == 46014
replace district_outcome = 2 if constituencynumber == 47001
replace district_outcome = 2 if constituencynumber == 47002
replace district_outcome = 2 if constituencynumber == 47003
replace district_outcome = 2 if constituencynumber == 47004
replace district_outcome = 2 if constituencynumber == 47005
replace district_outcome = 2 if constituencynumber == 47006
replace district_outcome = 2 if constituencynumber == 47007
replace district_outcome = 2 if constituencynumber == 47008
replace district_outcome = 2 if constituencynumber == 47009
replace district_outcome = 2 if constituencynumber == 47010
replace district_outcome = 2 if constituencynumber == 47011
replace district_outcome = 2 if constituencynumber == 47012
replace district_outcome = 2 if constituencynumber == 47013
replace district_outcome = 2 if constituencynumber == 47014
replace district_outcome = 2 if constituencynumber == 48001
replace district_outcome = 2 if constituencynumber == 48002
replace district_outcome = 2 if constituencynumber == 48003
replace district_outcome = 2 if constituencynumber == 48004
replace district_outcome = 2 if constituencynumber == 48005
replace district_outcome = 2 if constituencynumber == 48006
replace district_outcome = 2 if constituencynumber == 48007
replace district_outcome = 2 if constituencynumber == 48008
replace district_outcome = 2 if constituencynumber == 48009
replace district_outcome = 2 if constituencynumber == 48010
replace district_outcome = 2 if constituencynumber == 48011
replace district_outcome = 2 if constituencynumber == 48012
replace district_outcome = 2 if constituencynumber == 48013
replace district_outcome = 2 if constituencynumber == 48014
replace district_outcome = 2 if constituencynumber == 48015
replace district_outcome = 2 if constituencynumber == 48016
replace district_outcome = 2 if constituencynumber == 48017
replace district_outcome = 2 if constituencynumber == 48018
replace district_outcome = 3 if constituencynumber == 48019
replace district_outcome = 2 if constituencynumber == 48020
replace district_outcome = 2 if constituencynumber == 48021
replace district_outcome = 2 if constituencynumber == 48022
replace district_outcome = 2 if constituencynumber == 48023
replace district_outcome = 2 if constituencynumber == 48024
replace district_outcome = 2 if constituencynumber == 48025
replace district_outcome = 2 if constituencynumber == 48026
replace district_outcome = 2 if constituencynumber == 48027
replace district_outcome = 2 if constituencynumber == 48028
replace district_outcome = 2 if constituencynumber == 48029
replace district_outcome = 2 if constituencynumber == 48030
replace district_outcome = 2 if constituencynumber == 48031
replace district_outcome = 2 if constituencynumber == 48032
replace district_outcome = 2 if constituencynumber == 48033
replace district_outcome = 2 if constituencynumber == 48034
replace district_outcome = 2 if constituencynumber == 59001
replace district_outcome = 1 if constituencynumber == 59002
replace district_outcome = 3 if constituencynumber == 59003
replace district_outcome = 2 if constituencynumber == 59004
replace district_outcome = 2 if constituencynumber == 59005
replace district_outcome = 2 if constituencynumber == 59006
replace district_outcome = 2 if constituencynumber == 59007
replace district_outcome = 1 if constituencynumber == 59008
replace district_outcome = 3 if constituencynumber == 59009
replace district_outcome = 3 if constituencynumber == 59010
replace district_outcome = 1 if constituencynumber == 59011
replace district_outcome = 1 if constituencynumber == 59012
replace district_outcome = 2 if constituencynumber == 59013
replace district_outcome = 2 if constituencynumber == 59014
replace district_outcome = 2 if constituencynumber == 59015
replace district_outcome = 2 if constituencynumber == 59016
replace district_outcome = 2 if constituencynumber == 59017
replace district_outcome = 5 if constituencynumber == 59018
replace district_outcome = 3 if constituencynumber == 59019
replace district_outcome = 2 if constituencynumber == 59020
replace district_outcome = 1 if constituencynumber == 59021
replace district_outcome = 2 if constituencynumber == 59022
replace district_outcome = 2 if constituencynumber == 59023
replace district_outcome = 2 if constituencynumber == 59024
replace district_outcome = 2 if constituencynumber == 59025
replace district_outcome = 3 if constituencynumber == 59026
replace district_outcome = 5 if constituencynumber == 59027
replace district_outcome = 3 if constituencynumber == 59028
replace district_outcome = 3 if constituencynumber == 59029
replace district_outcome = 2 if constituencynumber == 59030
replace district_outcome = 2 if constituencynumber == 59031
replace district_outcome = 1 if constituencynumber == 59032
replace district_outcome = 1 if constituencynumber == 59033
replace district_outcome = 1 if constituencynumber == 59034
replace district_outcome = 3 if constituencynumber == 59035
replace district_outcome = 7 if constituencynumber == 59036
replace district_outcome = 3 if constituencynumber == 59037
replace district_outcome = 3 if constituencynumber == 59038
replace district_outcome = 1 if constituencynumber == 59039
replace district_outcome = 1 if constituencynumber == 59040
replace district_outcome = 3 if constituencynumber == 59041
replace district_outcome = 1 if constituencynumber == 59042
replace district_outcome = 1 if constituencynumber == 60001
replace district_outcome = 1 if constituencynumber == 61001
replace district_outcome = 3 if constituencynumber == 62001


************************
** DEPENDENT VARIABLE **
************************

* Favourability to poll ban (1 = strongly disagree, 2 = somewhat disagree, 3 = don't know, 4 = strongly agree, 5 = somewhat disagree)

gen ban = reviewversion_q3

recode ban 3 = 4 4 = 5 5 = 3 6 = .

* Favourability to poll ban (1 = disagree, 2 = don't know, 3 = agree)

gen ban3 = reviewversion_q3

recode ban3 1=1 2=1 3=3 4=3 5=2 6=.


***************************
** INDEPENDENT VARIABLES **
***************************

* Number of days before election

gen surveydate=date(string(cps19_current_date,"%8.0f"),"YMD")

format %tdMon_DD,_CCYY surveydate

gen edate = 20191021

gen electiondate=date(string(edate,"%8.0f"),"YMD") + 1

format %tdMon_DD,_CCYY electiondate

gen time = (electiondate - surveydate)

replace time = . if time < 0

* Year of birth

gen year_birth = cps19_yob + 1919

* Age in years

gen age = 2019 - year_birth

* Standardized age

egen z_age = std(age)

* Gender (0 = male, 1 = female)

gen female = cps19_gender

recode female 1=0 2=1 3=.

* Education (1 = no schooling, 2 = some elementary school, 3 = completed elementary school, 4 = some secondary/high school, 5 = completed secondary/high school, 6 = some technical, community college, Cegep, Collège classique, 7 = completed technical, community college, Cegep, Collège classique, 8 = some university, 9 = bachelor's degree, 10 = master's degree, 11 = professional degree or doctorate)

gen education = cps19_education

recode education 12=.

sum education

replace education = (education - `r(min)') / (`r(max)'-`r(min)')

* Postsecondary (0 = less than postsecondary education, 1 = postsecondary education)

gen postsecondary = cps19_education

recode postsecondary 1/6=0 7/11=1 12=.

* Francophone (0 = non-Francophone, 1 = Francophone)

gen franco = 0 if cps19_language_85!=1

replace franco = 1 if cps19_language_69 == 1

* Province (1 = Alberta, 2 = British Columbia, 3 = Manitoba, 4 = New Brunswick, 5 = Newfoundland Labrador, 6 = Nova Scotia, 7 = Ontario, 8 = PEI, 9 = Quebec, 10 = Saskatchewan)

gen province = cps19_province

recode province 19=. 21=. 26=. 14=1 15=2 16=3 17=4 18=5 20=6 22=7 23=8 24=9 25=10

* Political interest (0 = no interest at all, 10 = a great deal of interest)

gen interest = cps19_interest_gen_1

sum interest

replace interest = (interest - `r(min)') / (`r(max)'-`r(min)')

* Level of political interest (0 = low interest, 1 = high interest)

gen interest_high = 1 if cps19_interest_gen_1 >= 7 & cps19_interest_gen_1 <=10
replace interest_high = 0 if cps19_interest_gen_1 < 7 & cps19_interest_gen_1 >=0

* Ideology (0 = extreme left, 10 = extreme right)

gen ideology = cps19_lr_scale_bef_1

sum ideology

replace ideology = (ideology - `r(min)') / (`r(max)'-`r(min)')

* Politics is confusing (1 = strongly disagree, 2 = somewhat disagree, 3 = somewhat agree, 4 = strongly agree)

gen confusing = cps19_govt_confusing 

recode confusing 5=.

* Party identification (0 = no PID/DK, 1 = LPC, 2 = CPC, 3 = NPD, 4 = BQ, 5 = GPC, 6 = PPC, 7 = other)

gen pid = cps19_fed_id 

recode pid 8/9 = 0

* Party identification strength (1 = not very strongly, 2 = fairly strongly, 3 = very strongly)

gen pid_strength = cps19_fed_id_str

recode pid_strength 1=3 3=1 4=.

* Party identification strength (0 = not very/fairly strongly, 1 = very strongly)

gen pid_strong = pid_strength

recode pid_strong 1=0 2=0 3=1

* Perceived party ahead in the polls (1 = LPC, 2 = CPC, 3 = NPD, 4 = BQ, 5 = GPC, 6 = no party ahead/DK)

gen ahead = reviewversion_q2

recode ahead 5=6 7=. 8=5

* Does PID match with perceived party ahead in the polls? (1 = no, 2 = no PID/DK, 3 = yes)

gen partisan_ahead = 1 if ahead!=pid & pid!=0 & ahead!=6

replace partisan_ahead = 2 if pid == 0 | ahead == 6

replace partisan_ahead = 3 if ahead == pid & partisan_ahead!=1 & partisan_ahead!=2 & pid!=. // Possible BC categories (1, 2, 3, 4) correspond to the same parties


**********************
** VARIABLES LABELS **
**********************

label variable ban "Opinion on poll regulation (5 categories)"
label variable ban3 "Opinion on poll regulation (3 categories)"
label variable age "Age (unstandardized)"
label variable z_age "Age (standardized)"
label variable female "Gender (1 = female)"
label variable education "Education"
label variable postsecondary "Postsecondary education"
label variable franco "Francophone"
label variable province "Province"
label variable ideology "Left-right ideology"
label variable interest "Political interest"
label variable confusing "Politics is confusing"
label variable pid "Party identification"
label variable ahead "Party ahead"


******************
** VALUE LABELS **
******************

label define ban_labels 1 "Strongly Disagree" 2 "Somewhat agree" 3 "Don't know" 4 "Somewhat agree" 5 "Strongly agree"
label value ban ban_labels

label define ban3_labels 1 "Disagree" 2 "Don't know" 3 "Agree"
label value ban3 ban3_labels

label define female_labels 0 "Male" 1 "Female"
label value female female_labels

label define education_labels 1 "No schooling" 2 "Some elementary school" 3 "Completed elementary school" 4 "Some secondary/high school" 5 "Completed secondary/high school" 6 "Some technical, community college, Cegep, Collège classique" 7 "Completed technical, community college, Cegep, Collège classique" 8 "Some university" 9 "Bachelor's degree" 10 "Master's degree" 11 "Professional degree or doctorate"
label value education education_labels

label define postsecondary_labels 0 "No postsecondary education" 1 "Postsecondary education"
label value postsecondary postsecondary_labels

label define interest_high_labels 0 "Low interest" 1 "High interest"
label value interest_high interest_high_labels

label define franco_labels 0 "Non-Francophone" 1 "Francophone"
label value franco franco_labels

label define province_labels 1 "Alberta" 2 "British Columbia" 3 "Manitoba" 4 "New Brunswick" 5 "Newfoundland and Labrador" 6 "Nova Scotia" 7 "Ontario" 8 "Prince Edward Island" 9 "Quebec" 10 "Saskatchewan"
label value province province_labels

label define confusing_labels 1 "Strongly Disagree" 2 "Somewhat agree" 3 "Somewhat agree" 4 "Strongly agree"
label value confusing confusing_labels

label define pid_labels 0 "None/DK" 1 "Liberal Party of Canada" 2 "Conservative Party of Canada" 3 "New Democratic Party" 4 "Bloc Québécois" 5 "Green Party of Canada" 6 "Popular Party of Canada"
label value pid pid_labels

label define pid_strength_labels 1 "Not very strongly" 2 "Fairly strongly" 3 "Very strongly"
label value pid_strength pid_strength_labels

label define pid_strong_labels 0 "Not very/fairly strongly" 1 "Very strongly"
label value pid_strong pid_strong_labels

label define partisan_ahead_labels 1 "No" 2 "No PID/DK" 3 "Yes"
label value partisan_ahead partisan_ahead_labels


***************
** SAVE FILE **
***************	

keep ban3 partisan_ahead confusing ideology interest female franco z_age education province pid interest_high postsecondary pid_strength pid_strong

save "ca2019_ces_poll_regulation.dta", replace


*******************
** MAIN ANALYSES **
*******************

* Main model

eststo: mlogit ban3 ib3.partisan_ahead i.confusing ideology interest i.female i.franco z_age education i.province, baseoutcome(1)
esttab using main.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 8.province 9.province 10.province) wide b(2) se(2) nolz order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology interest 1.female 1.franco z_age education) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing", nolabel) width(\hsize) label interaction("$\times$") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" interest "Political interest" 1.female "Female" 1.franco "Francophone" z_age "Age" education "Education") replace
eststo clear

eststo: mlogit ban3 ib3.partisan_ahead i.confusing ideology interest i.female i.franco z_age education i.province, baseoutcome(1) rrr
esttab using main_rrr.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 8.province 9.province 10.province) wide b(2) se(2) nolz eform order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology interest 1.female 1.franco z_age education) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing", nolabel) width(\hsize) label interaction("$\times$") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" interest "Political interest" 1.female "Female" 1.franco "Francophone" z_age "Age" education "Education") replace
eststo clear

* Liberal partisans

eststo: mlogit ban3 ib3.partisan_ahead i.confusing ideology interest i.female i.franco z_age education i.province if pid == 1, baseoutcome(1)
esttab using main_lpc.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 8.province 9.province 10.province) wide b(2) se(2) nolz order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology interest 1.female 1.franco z_age education) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing", nolabel) width(\hsize) label interaction("$\times$") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" interest "Political interest" 1.female "Female" 1.franco "Francophone" z_age "Age" education "Education") replace
eststo clear

eststo: mlogit ban3 ib3.partisan_ahead i.confusing ideology interest i.female i.franco z_age education i.province if pid == 1, baseoutcome(1) rrr
esttab using main_lpc_rrr.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 8.province 9.province 10.province) wide b(2) se(2) nolz eform order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology interest 1.female 1.franco z_age education) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing", nolabel) width(\hsize) label interaction("$\times$") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" interest "Political interest" 1.female "Female" 1.franco "Francophone" z_age "Age" education "Education") replace
eststo clear

* Conservative partisans

eststo: mlogit ban3 ib3.partisan_ahead i.confusing ideology interest i.female i.franco z_age education i.province if pid == 2, baseoutcome(1)
esttab using main_cpc.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 8.province 9.province 10.province) wide b(2) se(2) nolz order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology interest 1.female 1.franco z_age education) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing", nolabel) width(\hsize) label interaction("$\times$") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" interest "Political interest" 1.female "Female" 1.franco "Francophone" z_age "Age" education "Education") replace
eststo clear

eststo: mlogit ban3 ib3.partisan_ahead i.confusing ideology interest i.female i.franco z_age education i.province if pid == 2, baseoutcome(1) rrr
esttab using main_cpc_rrr.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 8.province 9.province 10.province) wide b(2) se(2) nolz eform order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology interest 1.female 1.franco z_age education) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing", nolabel) width(\hsize) label interaction("$\times$") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" interest "Political interest" 1.female "Female" 1.franco "Francophone" z_age "Age" education "Education") replace
eststo clear

* New Democratic Party

eststo: mlogit ban3 ib3.partisan_ahead i.confusing ideology interest i.female i.franco z_age education i.province if pid == 3, baseoutcome(1)
esttab using main_ndp.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 9.province 10.province) wide b(2) se(2) nolz order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology interest 1.female 1.franco z_age education) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing", nolabel) width(\hsize) label interaction("$\times$") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" interest "Political interest" 1.female "Female" 1.franco "Francophone" z_age "Age" education "Education") replace
eststo clear

eststo: mlogit ban3 ib3.partisan_ahead i.confusing ideology interest i.female i.franco z_age education i.province if pid == 3, baseoutcome(1) rrr
esttab using main_ndp_rrr.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 9.province 10.province) wide b(2) se(2) nolz eform order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology interest 1.female 1.franco z_age education) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing", nolabel) width(\hsize) label interaction("$\times$") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" interest "Political interest" 1.female "Female" 1.franco "Francophone" z_age "Age" education "Education") replace
eststo clear

* No postsecondary education

eststo: mlogit ban3 ib3.partisan_ahead i.confusing ideology interest i.female i.franco z_age i.province if postsecondary == 0, baseoutcome(1)
esttab using main_nopost.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 8.province 9.province 10.province) wide b(2) se(2) nolz order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology interest 1.female 1.franco z_age) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing", nolabel) width(\hsize) label interaction("$\times$") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" interest "Political interest" 1.female "Female" 1.franco "Francophone" z_age "Age") replace
eststo clear

eststo: mlogit ban3 ib3.partisan_ahead i.confusing ideology interest i.female i.franco z_age i.province if postsecondary == 0, baseoutcome(1) rrr
esttab using main_nopost_rrr.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 8.province 9.province 10.province) wide b(2) se(2) nolz eform order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology interest 1.female 1.franco z_age) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing", nolabel) width(\hsize) label interaction("$\times$") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" interest "Political interest" 1.female "Female" 1.franco "Francophone" z_age "Age") replace
eststo clear

* Postsecondary education

eststo: mlogit ban3 ib3.partisan_ahead i.confusing ideology interest i.female i.franco z_age i.province if postsecondary == 1, baseoutcome(1)
esttab using main_post.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 8.province 9.province 10.province) wide b(2) se(2) nolz order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology interest 1.female 1.franco z_age) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing", nolabel) width(\hsize) label interaction("$\times$") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" interest "Political interest" 1.female "Female" 1.franco "Francophone" z_age "Age") replace
eststo clear

eststo: mlogit ban3 ib3.partisan_ahead i.confusing ideology interest i.female i.franco z_age i.province if postsecondary == 1, baseoutcome(1) rrr
esttab using main_post_rrr.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 8.province 9.province 10.province) wide b(2) se(2) nolz eform order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology interest 1.female 1.franco z_age) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing", nolabel) width(\hsize) label interaction("$\times$") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" interest "Political interest" 1.female "Female" 1.franco "Francophone" z_age "Age") replace
eststo clear

* Low political interest

eststo: mlogit ban3 ib3.partisan_ahead i.confusing ideology i.female i.franco z_age education i.province if interest_high == 0, baseoutcome(1)
esttab using main_low.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 8.province 9.province 10.province) wide b(2) se(2) nolz order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology 1.female 1.franco z_age education) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing", nolabel) width(\hsize) label interaction("$\times$") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" 1.female "Female" 1.franco "Francophone" z_age "Age" education "Education") replace
eststo clear

eststo: mlogit ban3 ib3.partisan_ahead i.confusing ideology i.female i.franco z_age education i.province if interest_high == 0, baseoutcome(1) rrr
esttab using main_low_rrr.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 8.province 9.province 10.province) wide b(2) se(2) nolz eform order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology 1.female 1.franco z_age education) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing", nolabel) width(\hsize) label interaction("$\times$") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" 1.female "Female" 1.franco "Francophone" z_age "Age" education "Education") replace
eststo clear

* High political interest

eststo: mlogit ban3 ib3.partisan_ahead i.confusing ideology i.female i.franco z_age education i.province if interest_high == 1, baseoutcome(1)
esttab using main_high.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 9.province 10.province) wide b(2) se(2) nolz order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology 1.female 1.franco z_age education) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing", nolabel) width(\hsize) label interaction("$\times$") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" 1.female "Female" 1.franco "Francophone" z_age "Age" education "Education") replace
eststo clear

eststo: mlogit ban3 ib3.partisan_ahead i.confusing ideology i.female i.franco z_age education i.province if interest_high == 1, baseoutcome(1) rrr
esttab using main_high_rrr.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 9.province 10.province) wide b(2) se(2) nolz eform order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology 1.female 1.franco z_age education) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing", nolabel) width(\hsize) label interaction("$\times$") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" 1.female "Female" 1.franco "Francophone" z_age "Age" education "Education") replace
eststo clear

* PID strength: not very/fairly strongly

eststo: mlogit ban3 ib3.partisan_ahead i.confusing ideology interest i.female i.franco z_age education i.province if pid_strong == 0, baseoutcome(1)
esttab using notstrong.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 8.province 9.province 10.province) wide b(2) se(2) nolz order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology interest 1.female 1.franco z_age education) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing", nolabel) width(\hsize) label interaction("$\times$") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" interest "Political interest" 1.female "Female" 1.franco "Francophone" z_age "Age" education "Education") replace
eststo clear

eststo: mlogit ban3 ib3.partisan_ahead i.confusing ideology interest i.female i.franco z_age education i.province if pid_strong == 0, baseoutcome(1) rrr
esttab using notstrong_rrr.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 8.province 9.province 10.province) wide b(2) se(2) nolz eform order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology interest 1.female 1.franco z_age education) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing", nolabel) width(\hsize) label interaction("$\times$") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" interest "Political interest" 1.female "Female" 1.franco "Francophone" z_age "Age" education "Education") replace
eststo clear

* PID strength: very strongly

eststo: mlogit ban3 ib3.partisan_ahead i.confusing ideology interest i.female i.franco z_age education i.province if pid_strong == 1, baseoutcome(1)
esttab using strong.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 8.province 9.province 10.province) wide b(2) se(2) nolz order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology interest 1.female 1.franco z_age education) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing", nolabel) width(\hsize) label interaction("$\times$") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" interest "Political interest" 1.female "Female" 1.franco "Francophone" z_age "Age" education "Education") replace
eststo clear

eststo: mlogit ban3 ib3.partisan_ahead i.confusing ideology interest i.female i.franco z_age education i.province if pid_strong == 1, baseoutcome(1) rrr
esttab using strong_rrr.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 8.province 9.province 10.province) wide b(2) se(2) nolz eform order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology interest 1.female 1.franco z_age education) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing", nolabel) width(\hsize) label interaction("$\times$") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" interest "Political interest" 1.female "Female" 1.franco "Francophone" z_age "Age" education "Education") replace
eststo clear


******************
** INTERACTIONS **
******************

* Interaction with PID strength

eststo: mlogit ban3 ib3.partisan_ahead##i.pid_strong i.confusing ideology interest i.female i.franco z_age education i.province, baseoutcome(1)
esttab using int_strength.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 8.province 9.province 10.province 0.pid_strong 1.partisan_ahead#0.pid_strong 2.partisan_ahead#0.pid_strong 3.partisan_ahead#0.pid_strong 3.partisan_ahead#1.pid_strong) wide b(2) se(2) nolz order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology interest 1.female 1.franco z_age education) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing" 1.partisan_ahead#1.pid_strong "Interaction", nolabel) width(\hsize) label interaction(" # ") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" interest "Political interest" 1.female "Female" 1.franco "Francophone" z_age "Age" education "Education" 1.partisan_ahead#1.pid_strong "   Does not match # Strong" 2.partisan_ahead#1.pid_strong "   None/DK # Strong") replace
eststo clear

* Average derivatives for each of the three outcomes with respect to partisan effect at both levels of PID strength

margins, dydx(partisan_ahead) at(pid_strong=(0 1))

* Contrasts of average marginal effects

margins r.pid_strong, dydx(partisan_ahead)

* Interaction with postsecondary education

eststo: mlogit ban3 ib3.partisan_ahead##i.postsecondary i.confusing ideology interest i.female i.franco z_age i.province, baseoutcome(1)
esttab using int_post.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 8.province 9.province 10.province 0.postsecondary 1.partisan_ahead#0.postsecondary 2.partisan_ahead#0.postsecondary 3.partisan_ahead#0.postsecondary 3.partisan_ahead#1.postsecondary) wide b(2) se(2) nolz order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology interest 1.female 1.franco z_age education) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing" 1.partisan_ahead#1.postsecondary "Interaction", nolabel) width(\hsize) label interaction(" # ") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" interest "Political interest" 1.female "Female" 1.franco "Francophone" z_age "Age" 1.partisan_ahead#1.postsecondary "   Does not match # Postsecondary" 2.partisan_ahead#1.postsecondary "   None/DK # Postsecondary") replace
eststo clear

* Average derivatives for each of the three outcomes with respect to partisan effect for respondent with and without postsecondary education

margins, dydx(partisan_ahead) at(postsecondary=(0 1))

* Contrasts of average marginal effects

margins r.postsecondary, dydx(partisan_ahead)

* Interaction with political interest

eststo: mlogit ban3 ib3.partisan_ahead##i.interest_high i.confusing ideology i.female i.franco z_age education i.province, baseoutcome(1)
esttab using int_interest.rtf, drop(3.partisan_ahead 1.confusing 0.female 0.franco 1.province 2.province 3.province 4.province 5.province 6.province 7.province 8.province 9.province 10.province 0.interest_high 1.partisan_ahead#0.interest_high 2.partisan_ahead#0.interest_high 3.partisan_ahead#0.interest_high 3.partisan_ahead#1.interest_high) wide b(2) se(2) nolz order(1.partisan_ahead 2.partisan_ahead 2.confusing 3.confusing 4.confusing ideology interest 1.female 1.franco z_age education) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) refcat(1.partisan_ahead "PID=Ahead?" 2.confusing "Politics is confusing" 1.partisan_ahead#1.interest_high "Interaction", nolabel) width(\hsize) label interaction(" # ") varlabels(_cons "Constant" 1.partisan_ahead "   Does not match" 2.partisan_ahead "   None/Don't know" 2.confusing "   Somewhat disagree" 3.confusing "   Somewhat agree" 4.confusing "   Strongly agree" ideology "Left-right ideology" 1.female "Female" 1.franco "Francophone" z_age "Age" education "Education" 1.partisan_ahead#1.interest_high "   Does not match # Interest" 2.partisan_ahead#1.interest_high "   None/DK # Interest") replace
eststo clear

* Average derivatives for each of the three outcomes with respect to partisan effect at both levels political interest

margins, dydx(partisan_ahead) at(interest_high=(0 1))

* Contrasts of average marginal effects

margins r.interest_high, dydx(partisan_ahead)

log close